import { createApp } from 'vue'
import '@/styles/style.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { store, key } from './store'
import App from './App.vue'
import router from './router'
import Pagination from '@/components/pagination'
import DialogForm from '@/components/DialogForm'
import locale from 'element-plus/lib/locale/lang/zh-cn'
//引入需要注册的全部组件
import globalComponent from '@/components/index' 

const app = createApp(App)

// 全局组件注册
for (const componentItme in globalComponent) {
  globalComponent[componentItme].install(app)
}

app.use(router)
// 注意: 引入的组件默认为英文, 添加locale可以将修改为中文
app.use(ElementPlus, {locale})
// 注意: 注册的时候使用了key,取值的时候也要添加key,useStore(key)
app.use(store, key)
app.mount('#app')
